clear 
cd "data directory here" 

use censusdata1995.dta
append using censusdata2000.dta


drop if HHnumber == .

gen college =0 
replace college = 1 if Education>=5


keep if Age>=25 & Age<=65


bys CensusYear: egen xx = mean(college) if Female == 1
bys CensusYear: egen yy = mean(college) if Female == 0
bys CensusYear: egen col_year_f = max(xx)
bys CensusYear: egen col_year_m = max(yy)
drop xx yy

bys CensusYear : gen Id_year = [_n]

  
bys CensusYear: egen xx = mean(college) if Female == 1 
bys CensusYear: egen yy = mean(college) if Female == 0 
bys CensusYear: egen col_F = max(xx)
bys CensusYear: egen col_M = max(yy)
drop xx yy
 
gen age2534 = 0 
gen age3544 = 0 
gen age4554 = 0 
gen age5565 = 0
replace age2534 = 1 if Age>=25 & Age<35
replace age3544 = 1 if Age>=35 & Age<45 
replace age4554 = 1 if Age>=45 & Age<55
replace age5565 = 1 if Age>=55 & Age<=65

gen after =0 
replace after = 1 if CensusYear>=2000


keep if employer == 1 & manufacturing == 1


keep if Sex == 2

gen dum = 0 
replace dum = 1 if CensusYear == 1995

ttest college, by(dum)
ttest married, by(dum)
ttest single, by(dum)
ttest divorced, by(dum)
ttest widowed, by(dum)
ttest Age, by(dum)
ttest age2534, by(dum)
ttest age3544, by(dum)
ttest age4554, by(dum)
ttest age5565, by(dum)